# hiawatha
# Builds from https://github.com/puppylinux-woof-CE/petbuilds
# File auto generated by ./mk_petbuild.sh. Edit as necessary.

. ../func
. ../build.conf

URL=https://www.hiawatha-webserver.org/files
PKG=hiawatha
VER=10.3
COMP=tar.gz
DESC="light weight webserver"
DEPS=
CAT=BuildingBlock
DESKTOP=hiawatha.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
# comment these 2 below if you use a custom package() function
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not

ARCH=$(uname -m)
case $ARCH in # set in build.conf
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

build_cmake() {
	cd ${PKG}-${VER}
	mkdir build
	cd build
	cmake .. \
		-DCMAKE_INSTALL_PREFIX="" \
		-DCMAKE_INSTALL_BINDIR=/usr/bin \
		-DCMAKE_INSTALL_SBINDIR=/usr/sbin \
		-DCMAKE_INSTALL_LIBDIR=/usr/${LIBDIR} \
		-DCMAKE_INSTALL_MANDIR=/usr/share/man \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc
	make DESTDIR=${CWD}/${PKG}-install install	
	cd ${CWD}
}

# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
build_cmake
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT
